﻿

using System;
using System.ServiceModel;
using DemoContract.Contract;



namespace DemoClientCustom
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ChannelFactory<ICalculator> channel = new ChannelFactory<ICalculator>("WSHttpBinding_CalculatorService"))
            {
                ICalculator proxy = channel.CreateChannel();
                using (proxy as IDisposable)
                {
                    var x = 1.0;
                    var y = 2.0;
                    Console.WriteLine("x = {0},y = {1},x+y = {2}", x, y, proxy.Add(x, y));
                    Console.WriteLine("x = {0},y = {1},x-y = {2}", x, y, proxy.Subtract(x, y));
                    Console.WriteLine("x = {0},y = {1},x*y = {2}", x, y, proxy.Multiply(x, y));
                    Console.WriteLine("x = {0},y = {1},x/y = {2}", x, y, proxy.Divide(x, y));
                }
            }
            Console.Read();
        }
    }
}
